﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Carwash.CW_Security;

namespace Carwash.CW_Security
{
    class CW_Security_Facade
    {
        private CW_Security security_instance;

        /// <summary>
        /// this method will delegate the execution of 'validatePassword'
        /// to the class CW_Security
        /// </summary>
        /// <param name="password"></param>
        /// <returns>returns whether the entered password is correct</returns>
        public bool validatePassword(int pin, int password)
        {
            security_instance = CW_Security.getInstance();
            return security_instance.validatePassword(pin, password);
        }

        public bool maxNumPasswordAttemptsExceeded()
        {
            security_instance = CW_Security.getInstance();
            return (security_instance.maxNumPasswordAttemptsExceeded());
        }

        public void resetPasswordAttempts()
        {
            security_instance = CW_Security.getInstance();
            security_instance.resetPasswordAttempts();
        }

        /// <summary>
        /// this method will delegate the execution of 'validatePin'
        /// to the class CW_Security
        /// </summary>
        /// <param name="pin"></param>
        /// <returns>returns the type of PIN associated with this pin</returns>
        public int validatePin(int pin)
        {
            security_instance = CW_Security.getInstance();
            return security_instance.validatePin(pin);
        }

        public bool maxNumPinAttemptsExceeded()
        {
            security_instance = CW_Security.getInstance();
            return (security_instance.maxNumPinAttemptsExceeded());
        }

        public void resetPinAttempts()
        {
            security_instance = CW_Security.getInstance();
            security_instance.resetPinAttempts();
        }

        /// <summary>
        /// this method will delegate the execution of 'verifyPasswordLength'
        /// to the class CW_Security
        /// </summary>
        /// <param name="password"></param>
        /// <returns>returns whether the entered password has an appropriate length</returns>
        public bool verifyPasswordLength(string password)
        {
            security_instance = CW_Security.getInstance();
            return security_instance.verifyPasswordLength(password);
        }

        public int getPinAttempts()
        {
            return security_instance.getPinAttempts();
        }

        public int getPasswordAttempts()
        {
            return security_instance.getPasswordAttempts();
        }
    }
}
